package com.doubledragon.boot;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by dragon
 */
public class ConfigurationTest {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(
                AnnotationOfConfiguration.class);
//        spring4.0
//        ApplicationContext ctx = new AnnotationConfigApplicationContext();
//        ctx.register(AnnotationOfConfiguration.class);

        TestBean testBean = (TestBean) annotationConfigApplicationContext.getBean("testBean");
        System.out.println(testBean.getTestStr());

        TestBean2 testBean2 = (TestBean2) annotationConfigApplicationContext.getBean("testBean2");
        System.out.println(testBean2.getTestStr());
    }
}
